<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<header>
    <nav class="navbar navbar-inverse navbar-index">
        <div class="container">
            <div class="navbar-header">
                <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!--下面这行放置logo图案或者图标-->
                <span class="navbar-brand">logo</span>
            </div>
            <div class="collapse navbar-collapse nav-justified" role="navigation">
                <ul class="nav navbar-nav navbar-left">
                    <li id="index"><a href="${pageContext.request.contextPath}/index/index.action">首页</a></li>
                    <li id="newup"><a href="">新品上市</a></li>
                    <li id="pickup"><a href="">精选美食</a></li>
                    <li id="fashion"><a href="">名店抢购</a></li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <%if (request.getSession().getAttribute("user_phone") != null){ %>
                    <li id="head_img">
                        <img class="header-img" src="/image/home/1.jpg">
                    </li>
                    <% } %>
                    <%if (request.getSession().getAttribute("user_phone") == null){ %>
                    <li id="login"><a href="${pageContext.request.contextPath}/login/jumpTologinPage.action?flag=0">登录</a></li>
                    <li id="register">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" arie-expanded="false">注册<span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="${pageContext.request.contextPath}/register/jumpToRegisterPage.action?flag=0">用户注册</a></li>
                            <li class="divider"></li>
                            <li><a href="${pageContext.request.contextPath}/register/jumpToRegisterPage.action?flag=1">商家注册</a></li>
                        </ul>
                    </li>
                    <% } %>
                    <%if (request.getSession().getAttribute("user_phone") != null){ %>
                    <li id="shoppingcart"><a href="">购物车</a></li>
                    <% }%>
                    <%if (request.getSession().getAttribute("user_phone") != null){ %>
                    <li id="selfInfo">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" arie-expanded="false">个人中心<span class="label label-danger label-style">2</span><span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="">我的积分</a></li>
                            <li class="divider"></li>
                            <li><a href="">我的收藏</a></li>
                            <li class="divider"></li>
                            <li><a href="">我的余额</a></li>
                            <li class="divider"></li>
                            <li><a href="">修改信息</a></li>
                            <li class="divider"></li>
                            <li><a href="">我的订单</a></li>
                            <li class="divider"></li>
                            <li><a href="">消息通知<span class="badge badge-right">2</span></a></li>
                            <li class="divider"></li>
                            <li><a href="${pageContext.request.contextPath}/index/logout.action">退出</a></li>
                        </ul>
                    </li>
                    <% } %>
                </ul>
            </div>
        </div>
    </nav>
</header>